<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Mail</title>
<script type="text/javascript">
validarCamposMail = function(){
	try{
		var valEnt = 0;
		var frmSendMail = document.getElementById("frmMailUsuario");
		//var mailDe = frmSendMail.elements['mailDe'].value;
		var mailPara = frmSendMail.elements['mailPara'].value;
		var mailCcp = frmSendMail.elements['mailCcp'].value;
		var mailAsunto = frmSendMail.elements['mailAsunto'].value;
		var mailContenido = frmSendMail.elements['mailContenido'].value;
		
		//var errorDivDe = document.getElementById("errorDivDe");
		var errorDivPara = document.getElementById("errorDivPara");
		var errorDivCcp = document.getElementById("errorDivCcp");
		var errorDivAsunto = document.getElementById("errorDivAsunto");
		var errorDivContenido = document.getElementById("errorDivContenido");
		/*
		if(mailDe == ""){
			document.getElementById("errorDivDe").innerHTML = "El campo esta vacio";
			valEnt ++;
		} else {
			document.getElementById("errorDivDe").innerHTML = "";
		}
		*/
		if(mailPara == ""){
			document.getElementById("errorDivPara").innerHTML = "El campo esta vacio";
			valEnt ++;
		} else {
			document.getElementById("errorDivPara").innerHTML = "";
		}
		if(mailCcp == ""){
			document.getElementById("errorDivCcp").innerHTML = "El campo esta vacio";
			valEnt ++;
		} else {
			document.getElementById("errorDivCcp").innerHTML = "";
		}
		if(mailAsunto == ""){
			document.getElementById("errorDivAsunto").innerHTML = "El campo esta vacio";
			valEnt ++;
		} else {
			document.getElementById("errorDivAsunto").innerHTML = "";
		}
		if(mailContenido == ""){
			document.getElementById("errorDivContenido").innerHTML = "El campo esta vacio";
			valEnt ++;
		} else {
			document.getElementById("errorDivContenido").innerHTML = "";
		}
		if(valEnt == 0){
			frmSendMail.submit();
		}
	}catch(e){
		alert("validarCamposRolEditar  [  " + e);
	}
};
</script>
</head>
<body>
<div id="global">
<div id="header">
<jsp:include page="/header.jsp"></jsp:include>
</div>
<div id="body">
<h3 class="ui-widget-header">ENVIAR E-MAIL</h3>
<div id="form-roles">
<form action="${pageContext.request.contextPath}/mail/mailController?method=1" id="frmMailUsuario" name="frmMailUsuario" method="post">
    <table id="table-form-roles">
        <!--tr>
           <td class="label">
               <label for="">DE: </label>
           </td>
           <td class="control">
               <input type="text" name="mailDe" id="mailDe"  value="" class="required"/>
               <div id="errorDivDe" style="color:red;"></div>
           </td>
       </tr-->
       <tr>
           <td class="label">
               <label for="">PARA: </label>
           </td>
           <td class="control">
               <input type="text" name="mailPara" id="mailPara"  value="" class="required" />
               <div id="errorDivPara" style="color:red;"></div>
           </td>
       </tr>
       <tr>
           <td class="label">
               <label for="">CCP: </label>
           </td>
           <td class="control">
               <input type="text" name="mailCcp" id="mailCcp"  value="" class="required" />
               <div id="errorDivCcp" style="color:red;"></div>
           </td>
       </tr>
       <tr>
           <td class="label">
               <label for="">ASUNTO:</label>
           </td>
           <td class="control">
               <input type="text" name="mailAsunto" id="mailAsunto"  value="" class="required" />
               <div id="errorDivAsunto" style="color:red;"></div>
           </td>
       </tr>
       <tr>
           <td class="label">
               <label for="">CONTENIDO:</label>
           </td>
           <td class="control">
           
               <textarea name="mailContenido" id="mailContenido" rows="10" cols="45"></textarea>
               <div id="errorDivContenido" style="color:red;"></div>
           </td>
       </tr>
       <tr>
              <td colspan="2" align="center"><input type="button" value="Send" class="buttonGreen" onclick="validarCamposMail();"/></td>
       </tr>
    </table>
</form>
</div>
</div>
</div>
</body>
</html>
